define(function (require, exports, module) {



    var _ = require("http://localhost:8180//git-my/vue-ladder/src/lib/lodash.js");

    require("components/card/index.js");

    // 1.创建一个组件构造器
    var abc = Vue.extend({
        template: '<div><slot></slot></div>'
    })

    // 2.注册组件，并指定组件的标签，组件的HTML标签为<my-component>
    Vue.component('my-abc', abc)



    var VueComponent = new Vue({
        el: '#app',
        data: {
            tableData: [],
            title_01: '基本信息 (暂列成数据库计划字段)',
            title_02: '负载配置 -- 统一采用 ip_hash 方式',
            title_03: '路由配置',
            title_04: 'Nginx类负载生成脚本',
            proxy_data: {
                upstream: [
                    {
                        server: '192.168.102.1:8080',
                        machine: '物理机',
                        weight: 1,
                        isBack: '否',
                        remark: '4核 16G'
                    }, {
                        server: '192.168.102.2:8080',
                        weight: 2,
                        isBack: '否',
                        machine: 'Docker',
                        remark: '8核 16G'
                    }, {
                        server: '192.168.102.3:8080',
                        machine: '物理机',
                        weight: 1,
                        isBack: '否',
                        remark: '4核 16G'
                    }, {
                        server: '192.168.102.4:8080',
                        weight: 1,
                        isBack: '是',
                        machine: 'Docker',
                        remark: '4核 8G'
                    }],
                rewrite: [{
                    reg: '^~ /cube/modules/',
                    toReg: 'root /webroot/static/modules',
                    remark: '外观模式,过我方分发服务器统一url标准',
                    order: 999
                }, {
                    reg: '/',
                    toReg: 'proxy_pass http://www.ctrip.com/xxx/logError?$1',
                    remark: '最低优先级,未匹配上则中转到日志接口',
                    order: 1
                }]
            }
        },
        mounted: function () {
            var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
                mode: "text/javascript",
                height: 800,
                extraKeys: { "Ctrl-Space": "autocomplete" },
                autoCloseTags: true,
                lineNumbers: true,
                styleActiveLine: true,
                theme: 'monokai'
            });

            editor.on('change', function() {  
                editor.showHint(); //满足自动触发自动联想功能  
            }); 

            var editor2 = CodeMirror.fromTextArea(document.getElementById("sql"), {
                mode: "text/x-mssql",
                height: 800,
                extraKeys: { "Ctrl-Space": "autocomplete" },
                autoCloseTags: true,
                lineNumbers: true,
                styleActiveLine: true,
                theme: 'monokai',

                indentWithTabs: true,
                smartIndent: true,
                lineNumbers: true,
                matchBrackets: true,
                autofocus: true,
                extraKeys: { "Ctrl-Space": "autocomplete" },
                hintOptions: {
                    tables: {
                        users: ["name", "score", "birthDate"],
                        countries: ["name", "population", "size"]
                    }
                }
            });

            editor2.on('change', function() {  
                editor.showHint(); //满足自动触发自动联想功能  
            }); 
        },
        created: function () {
            //实际中应该发异步
            this.tableData;
            var basicInfo = {
                id: '1001',
                supplierShortName: '江苏梦兰神彩',
                chargeUserName: '王孟贵',
                chargeUserPhone: '18627726186',
                createTime: '2017-10-01',
                isGathered: '集中布曙',
                foreIdentity: 'm'
            };


            for (x in basicInfo) {
                this.tableData.push({
                    key: x,
                    value: basicInfo[x]
                });
            }

            console.log(this.tableData);
        }
    });

});